import {getDetails} from "../../request/api"
const state = {
    details:[]
}
const mutations = {
    changeDetails(state,arr){
        state.details=arr;
    }
}
const actions = {
    detailsActions(context,id){
        let params={
            id:id
        }
        getDetails(params).then(res=>{
            if(res.code===200){
                context.commit("changeDetails",res.list[0]);
            }
        })
    }
}
const getters = {
    details(){
        return state.details;
    }
}

export default {
    state,
    mutations,
    actions,
    getters,
    namespaced: true
}